//
//  YTRefreshHeader.m
//  yitaicaijing
//
//  Created by DIANGHONG on 2018/9/4.
//  Copyright © 2018年 DIANGHONG. All rights reserved.
//

#import "YTRefreshHeader.h"

#define kIdleImageCount 69
@interface YTRefreshHeader ()
@property(nonatomic ,strong)NSArray *idleImages;

@end
@implementation YTRefreshHeader
- (NSArray *)idleImages
{
    if (!_idleImages) {
        NSMutableArray *arrayM = [NSMutableArray arrayWithCapacity:5];
        for (int i = 1; i < kIdleImageCount ; i++) {
            UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"图层%d",i]];
            
            [arrayM addObject:image];
        }
        
        _idleImages = arrayM.copy;
    }
    return _idleImages;
}

- (void)prepare
{
    [super prepare];
    
    [self setImages:@[self.idleImages.firstObject] forState:MJRefreshStateIdle];
    [self setImages:self.idleImages duration:1.5 forState:MJRefreshStatePulling];
    self.lastUpdatedTimeLabel.hidden = YES;
    self.stateLabel.hidden = YES;
    self.backgroundColor = [UIColor colorWithHex:@"f1f2f2"];

}

@end
